<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="root">
    <!-- 父组件中调用子组件 -->
    <Child>
      <!-- 组件里面面的内容，用户自定义 -->
      <h1>hello world</h1>
    </Child>

    <Child>
      <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
      </ul>
    </Child>

    <Child2>
      <Child>
        <ul>
          <li>1</li>
          <li>2</li>
          <li>3</li>
        </ul>
      </Child>
    </Child2>
  </div>
  <script type="text/x-template" id="child">
  <div>
    <h3>插槽文字</h3>
    <!-- 插槽 占位 -->
    <slot></slot>
  </div>
  </script>
  <script src="./js/vue.js"></script>
  <script>
    const Child = {
      template: '#child'
    }

    const Child2 = {
      template: `<div>aaaaa----<slot></slot></div>`
    }


    new Vue({
      el: '#root',
      components: {
        Child,
        Child2
      }
    })
  </script>
</body>

</html>